import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/page/home'
import HomeIndex from '@/page/home/index'
import Cart from '@/page/home/cart'
import User from '@/page/home/user'
import Classification from '@/page/home/classification'
// 首页
import Sign from '@/page/activity/sign'
import Answers from '@/page/activity/answers'
//分类

//我的
import Setting from '@/page/users/setting'
import Helpcenter from '@/page/users/helpcenter'
import Address from '@/page/users/address'
//商品
import ListPage from '@/page/goods/listPage'
import Spike from '@/page/goods/spike'
import Benefit from '@/page/goods/benefit'
import Assemble from '@/page/goods/assemble'
import commDetail from '@/page/goods/commDetail'
import confirmation from '@/page/order/confirmation'
// 订单
import Payment from '@/page/order/payment'
import Order from '@/page/order'
// 试用
import OnTrial from '@/page/goods/onTrial'
import Trial from '@/page/trial/trial'
import MyTrial from '@/page/trial/mytrial'
import TrialReport from '@/page/trial/TrialReport'
Vue.use(Router)
export default new Router({
  routes: [{
    path: '/',
    component: Index,
    children: [{
      name: 'home',
      path: '',
      component: HomeIndex
    }, {
      name: 'user',
      path: '/user',
      component: User
    }, {
      name: 'classification',
      path: '/classification',
      component: Classification
    }, {
      name: 'cart',
      path: '/cart',
      component: Cart
    }]
  }, {
    name: 'setting',
    path: '/setting',
    component: Setting
  }, {
    name: 'helpcenter',
    path: '/helpcenter',
    component: Helpcenter
  }, {
    name: 'address',
    path: '/address',
    component: Address
  }, {
    name: 'listPage',
    path: '/listpage',
    component: ListPage
  }, {
    name: 'spike',
    path: '/spike',
    component: Spike
  }, {
    name: 'sign',
    path: '/sign',
    component: Sign
  }, {
    name: 'answers',
    path: '/answers',
    component: Answers
  }, {
    name: 'benefit',
    path: '/benefit/:type',
    component: Benefit
  }, {
    name: 'assemble',
    path: '/assemble',
    component: Assemble
  }, {
    path: '/onTrial',
    component: OnTrial,
    children: [{
      path: 'trial/:type',
      name: 'trial',
      component: Trial
    }, {
      path: 'mytrial',
      name: 'mytrial',
      component: MyTrial
    }]
  }, {
    name: 'trial-report',
    path: '/trialreport',
    component: TrialReport
  }, {
    name: 'comm-detail',
    path: '/commdetail',
    component: commDetail
  }, {
    name: 'confirmation',
    path: '/confirmation',
    component: confirmation
  }, {
    name: 'payment',
    path: '/payment',
    component: Payment
  }, {
    name: 'order',
    path: '/order',
    component: Order
  }]
})
